package morning.cat.exception.notruntimeexception;

/**
 * XXX
 *
 * @author mengzhang6
 * @date 2018/12/26 14:00
 */
public class AutoCloseTestModel implements AutoCloseable {
    @Override
    public void close() throws Exception {
        System.out.println("资源管理");
    }

    public void run(boolean flag) {
        if (flag) {
            System.out.println("业务处理");
        } else {
            System.out.println("出现异常");
            throw new RuntimeException("自定义RuntimeException");
        }
    }
}
